{temp('admin/head')}

</head>
<body class="page-body">
	
			
		{temp('admin/left')}

			{temp('admin/top')}
			<div class="row">
				<div class="col-sm-12">
					
					<div class="panel panel-default">
						<div class="panel-heading">
							<h3 class="panel-title">{$tit}</h3>
						</div>
						<div class="panel-body">							
							<div class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-2 control-label" for="field-1">组名称</label>
									
									<div class="col-sm-10">
										<input type="text" class="form-control" id="name" style="width:30%;">
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label">权限</label>
									
									<div class="col-sm-10" style="padding-left:6px;">
										<p>
										{if(@$wzgn)}
											{foreach($wzgn as $k=>$v)}
											<label class="checkbox-inline" style="margin-left:10px;">
												<input type="checkbox" value="{$v['id']}" name="qx" id="gn_{$v['id']}" />
												{$v['name']}
											</label>
											{/foreach}
									    {/if}
										</p>
										<p style="color:red;">注：当选择静态管理时，必须选择新闻管理，静态管理才有效</p>
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<div class="col-sm-10">
										<button class="btn btn-info btn-single pull-right" onclick="tj()" type="button">提交</button>
									</div>
								</div>
							</div>							
						</div>
					</div>
					
				</div>
			</div>
		{temp('admin/foot')}
		
	<script type="text/javascript">
		function tj(){
			var name = $("#name").val();
			var qx =[];//定义一个数组
			$('input[name="qx"]:checked').each(function(){//遍历每一个名字为interest的复选框，其中选中的执行函数
				qx.push($(this).val());//将选中的值添加到数组chk_value中
			});
			$.post('/admin/?act=xitong&met=zu_tj{$gnpd}',{name:name,qx:qx},function(data){
				if(data == 'cg'){
					alert('添加成功');
					location.href = '/admin/?act=xitong&met=zu{$gnpd}';
				}else if(data == 'error'){
					alert('添加失败');
				}else if(data == '-1'){
					alert('组名称不能为空');
				}else if(data == '-2'){
					alert('没有选择权限');
				}else{
					alert('系统故障');
				}
			});
		}
	</script>
	<!-- Bottom Scripts -->
	<script src="{$adstyle}/js/bootstrap.min.js"></script>
	<script src="{$adstyle}/js/TweenMax.min.js"></script>
	<script src="{$adstyle}/js/resizeable.js"></script>
	<script src="{$adstyle}/js/joinable.js"></script>
	<script src="{$adstyle}/js/xenon-api.js"></script>
	<script src="{$adstyle}/js/xenon-toggles.js"></script>

	<!-- Imported scripts on this page -->
	<script src="{$adstyle}/js/select2/select2.min.js"></script>

	<!-- JavaScripts initializations and stuff -->
	<script src="{$adstyle}/js/xenon-custom.js"></script>
</body>
</html>